package com.example.demo.mapper;

import com.example.demo.entity.UsersFriend;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.dto.MyFriendsAddInfoDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 好友关系 Mapper 接口
 * </p>
 *
 * @author Mr.Abel
 * @since 2024-03-13
 */
@Mapper
public interface UsersFriendMapper extends BaseMapper<UsersFriend> {

    @Select("select uf.id,uf.user_id,ui.nickname,uf.create_time\n" +
            "from users_friend as uf,users_info as ui\n" +
            "where uf.friend_id = #{id} \n" +
            "and uf.status = #{status}\n" +
            "and uf.user_id = ui.userId\n")
    List<MyFriendsAddInfoDTO> getMyFriendsAddInfoMapper(@Param("id") Integer id,@Param("status")  Integer status);




}
